function openImportWindow() {

    var dsStore = Ext.create('Ext.data.Store', {
        autoLoad: true,
        pageSize: 1000,
        remoteSort: true,
        remoteFilter:true,

        proxy: {
            type: 'ajax',
            url : '../datasource/store',
            reader: {
                type: 'json',
                root: 'results',
                totalProperty: 'total'
            }
        }
    });

    var dsGrid = Ext.create('Ext.grid.Panel', {
        store: dsStore,
        columns: [
            { text: 'ID', dataIndex: 'id',width:50 },
            { text: '名称', dataIndex: 'name',width:150 },
            { text: '类型', dataIndex: 'ds_type',width:150 },
            { text: 'IP', dataIndex: 'ip',width:150 },
            { text: '端口', dataIndex: 'port',width:90 },
            { text: '数据库', dataIndex: 'db',width:90 },
            { text: '用户名', dataIndex: 'userloginid',flex:1 }
        ],
        height: '100%',
        width: '100%'
    });



    var ctStore = Ext.create('Ext.data.Store', {
        autoLoad: true,
        pageSize: 1000,
        remoteSort: true,
        remoteFilter:true,
        proxy: {
            type: 'ajax',
            url : '../charttheme/store',
            reader: {
                type: 'json',
                root: 'results',
                totalProperty: 'total'
            }
        }
    });


    var chartThemeGrid = Ext.create('Ext.grid.Panel', {
        store: ctStore,
        selType: 'checkboxmodel',
        columns:[
            { text: "主题ID", dataIndex: "id" },
            { text: "主题名称", dataIndex: "theme_name" },
            {
                text: "主题预览",
                dataIndex: "theme_source",
                width:500,
                renderer:function(value,metaData,record) {
                    try{
                        var themeJson = JSON.parse(value)
                        var temp = "<div >&nbsp;"

                        if (themeJson.backgroundColor!=null) {
                            temp = "<div style='background-color:"+themeJson.backgroundColor+";height:25px;line-height:25px;text-align:left;vertical-align:middle' >&nbsp;"
                        }

                        if (themeJson.color!=null) {
                            for(var i=0;i<themeJson.color.length;i++) {
                                temp += "<span style='width:35px;height:25px;border:0px solid;background-color:"+themeJson.color[i]+
                                    "'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;"
                            }
                        }
                        temp += "</div>"
                        return temp
                    } catch(e) {
                        return ""
                    }

                }
            }
        ],
        height: '100%',
        width: '100%'
    });



    var window = Ext.create('Ext.window.Window', {
        title: "导入",
        iconCls: 'x-fa fa-database',
        width: 850,
        height:600,
        modal: true,
        items: [{
            xtype: 'form',
            width: '100%',
            height: 567,
            border: false,
            items: [
                {
                    xtype: 'tabpanel',
                    items:[
                        {
                            title:"图表文件",
                            items:[
                                {
                                    xtype:'treepanel',
                                    viewConfig:{

                                    },
                                    id:'importFile',
                                    height:511,
                                    width:'100%',
                                    checkPropagation: 'both',
                                    allowDeselect:true,
                                    scrollable:true,
                                    reserveScrollbar: true,
                                    useArrows: true,
                                    rootVisible: false,
                                    multiSelect: false,
                                    singleExpand: false,
                                    listeners:{
                                        select:function(obj, record, index, eOpts){


                                        },
                                        deselect:function( obj, record, index, eOpts ) {

                                        }
                                    },
                                    store: {
                                        listeners:{
                                            load :function( obj, records, successful, operation, node, eOpts ) {
                                                Ext.getCmp("importFile").expandAll()

                                            },
                                            select:function() {

                                            }
                                        },
                                        type: 'tree',
                                        proxy: {
                                            type: 'ajax',
                                            url: '../file/store?cbFlag=true'
                                        }
                                    },
                                    columns: [
                                        /*{
                                            xtype:'checkcolumn',
                                            dataIndex: 'ddd',
                                            text:''
                                        },*/
                                        {
                                            xtype: 'treecolumn',
                                            text: '目录/文件',
                                            dataIndex: 'fileName',
                                            flex: 1
                                        },
                                        {
                                            text: '创建日期',
                                            dataIndex: 'dateCreated',
                                            flex: 1,
                                            sortable: true,
                                            align: 'center',
                                            renderer: function(value){
                                                return Ext.Date.format(new Date(value), 'Y-m-d H:i')
                                            }
                                        },
                                        {
                                            text: '修改日期',
                                            dataIndex: 'lastUpdated',
                                            flex: 1,
                                            sortable: true,
                                            align: 'center',
                                            renderer: function(value){
                                                return Ext.Date.format(new Date(value), 'Y-m-d H:i')
                                            }
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            title:"数据源",
                            items:[
                                dsGrid
                            ]
                        },
                        {
                            title:"图表主题",
                            items:[
                                chartThemeGrid
                            ]
                        },
                        {
                            title:"表格主题",
                            items:[

                            ]
                        }
                    ]
                }
            ],
            buttons: [{
                xtype: 'button',
                text: '取消',
                handler: function () {
                    window.close()
                }
            },
                {
                    xtype: 'button',
                    text: '确定',
                    handler: function () {



                    }
                }
            ]
        }]
    })
    window.show()


}
